package chapter10;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created with IntelliJ IDEA.
 * Description:
 *
 * @author lzy
 * @create 2018-03-20 下午4:37
 */
public class StringBufferTest {
    private static final Logger LOGGER = LoggerFactory.getLogger(StringBufferTest.class);

    public static void main(String[] args) {
        StringBuffer sb = new StringBuffer("www.crscd.com");
        System.out.println(sb.reverse());
        sb.insert(9, "test");
        System.out.println(sb);

        Runtime runtime = Runtime.getRuntime();
        LOGGER.info("maxMemory:{} MB",runtime.maxMemory()/1024/1024.0);
        LOGGER.info("totalMemory:{} MB",runtime.totalMemory()/1024/1024.0);
        LOGGER.info("freeMemory:{} MB",runtime.freeMemory()/1024/1024.0);
    }
}
